package fhb.mobile.manager.remoteDB;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.os.AsyncTask;
import fhb.mobile.manager.Storage;
import fhb.mobile.todoapp.datamodell.ToDoItem;

public class DeleteRemoteDB extends AsyncTask<ToDoItem, String, String>{
	
	protected static final String servername = "10.0.2.2/android";

	@Override
	protected String doInBackground(ToDoItem... params) {
		ToDoItem todo = params[0];
		String request = "http://" + servername + "/delete.php?create="
				+ todo.getCreateDate() + "&mail=" +Storage.getUsername();
		HttpClient hc = new DefaultHttpClient();
		HttpGet post = new HttpGet(request);
		try {
			hc.execute(post);
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

}
